import 'package:dio/dio.dart';
import 'package:imove/net/request.dart';

import '../confit.dart';

class NetHelp with BaseRequest{
  static NetHelp _instance = NetHelp._();
  static NetHelp get instance => _instance;
  factory NetHelp() => _instance;
 

  NetHelp._(){
    Dio dio;
    BaseOptions options = BaseOptions(
      baseUrl: AppConfig.baseUrl,
      connectTimeout: 30000,
      receiveTimeout: 3000,
    );
    dio = Dio(options);
    dio.interceptors.add(
      LogInterceptor(
        request: AppConfig.isDebug,
        requestHeader: AppConfig.isDebug,
        responseHeader: AppConfig.isDebug,
        error: AppConfig.isDebug,
        responseBody: AppConfig.isDebug
      )
    );
    setDio(dio);
  }
}